<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<ui:composition template="layout/layout.xhtml">
	<ui:define name="menu">
		<ui:include src="layout/menu_admin.xhtml" />
	</ui:define>
	<ui:define name="content">
		<f:view locale="#{LocalizationController.locale}">
			<h:form class="form-horizontal" styleClass="form-horizontal">
				<div class="span4">
					<h3><h:outputText value="#{msgs.Admin8Detail}"/></h3>
					<div class="control-group" style="margin-top:20px;">
    					<label class="control-label" for="input_username"><h:outputText value="#{msgs.Common23Name}"/> *</label>
						<div class="controls">
							<h:inputText id="input_username" value="#{UserAdminController.selectedUser.name}" />
						</div>
  					</div>
					<div class="control-group">
    					<label class="control-label" for="input_surname"><h:outputText value="#{msgs.Common24Surname}"/> *</label>
						<div class="controls">
							<h:inputText id="input_surname" value="#{UserAdminController.selectedUser.surname}" />
						</div>
					</div>
					<div class="control-group">
    					<label class="control-label" for="input_email"><h:outputText value="#{msgs.Common25email}"/> *</label>
						<div class="controls">
							<h:inputText id="input_email" value="#{UserAdminController.selectedUser.eMail}" />
						</div>
					</div>
					<div class="control-group">
    					<label class="control-label" for="input_password"><h:outputText value="#{msgs.Common26Password}"/> *</label>
						<div class="controls">
							<h:inputSecret id="input_password" redisplay="true" value="#{UserAdminController.selectedUser.password}" />
						</div>
					</div>
					<div class="control-group">
    					<label class="control-label" for="input_password_confirm"><h:outputText value="#{msgs.Common27ConfirmPassword}"/> *</label>
						<div class="controls">
							<h:inputSecret id="input_password_confirm" redisplay="true" value="#{UserAdminController.currentPasswordConfirm}" />
						</div>
					</div>
					<div class="control-group">
						<label for="menu_role" class="control-label"><h:outputText value="#{msgs.Common28Role}"/> *</label>
						<div class="controls">
							<h:selectOneMenu id="menu_role" value="#{UserAdminController.selectedRole}">
								<f:selectItems value="#{UserAdminController.roleSelect}" />
							</h:selectOneMenu>
						</div>
					</div>
					<div class="control-group">
						<label for="menu_group" class="control-label"><h:outputText value="#{msgs.Common29Group}"/> *</label>
						<div class="controls">
							<h:selectOneMenu id="menu_group" value="#{UserAdminController.selectedGroup}">
								<f:selectItems value="#{UserAdminController.groupSelect}" />
							</h:selectOneMenu>
						</div>
					</div>
					
					<div class="control-group">
						
						<div class="controls">
							<h:commandLink rendered="#{UserAdminController.isUserEditMode}" styleClass="btn btn-primary" value="#{msgs.Common4Save}"
      						action="#{UserAdminController.updateUser}"/>
	      					<h:commandLink rendered="#{!UserAdminController.isUserEditMode}" styleClass="btn btn-primary" value="#{msgs.Common1Create}"
	      						action="#{UserAdminController.createNewUser}" />
	      					<h:commandLink styleClass="btn" value="#{msgs.Common2Cancel}" action="#{UserAdminController.cancel}" style="margin-left: 10px;"/>
						</div>
					</div>
					
					<div class="control-group">
						
						<div class="controls" style="width: 240px;">
							<a4j:outputPanel styleClass="formErrorMessage" ajaxRendered="true" rendered="#{UserAdminController.showUserFormMessage}">
		      					<div class="alert alert-error">
									<h:outputText value="#{UserAdminController.userFormMessage}" rendered="#{UserAdminController.showUserFormMessage}" />		
								</div>	
							</a4j:outputPanel>	
						</div>
					</div>
	
  				</div>
  				<div class="span5"> </div>
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>
</html>